<!doctype html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml" xmlns:v-model="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
<pre>
    v-if:
    值为真时则渲染元素
    值为假时不渲染或移除元素
</pre>
<div id="app">
    <h1 v-if="ok">Yes</h1>
    <h1 v-else="ok">No</h1>
</div>
</body>
<script src="../../vender/vue@2.4.2.js"></script>
<script>

    var app=new Vue({
        el:'#app',
        data:{
            ok:Math.random()<0.5
        }
    });

</script>
</html>